package com.one.blocks.common.request;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @author linfuxin Created on 2022-02-14 10:41:58
 */
@ApiModel(value = "滚动分页参数")
@Data
@ToString(callSuper = true)
public class ScrollPageRequest<T extends Serializable & Comparable<? super T>> implements Serializable {

    /**
     * 起始数据
     */
    @NotNull
    @ApiModelProperty(value = "上次最新请求id", example = "0")
    private T preValue;

    /**
     * 分页大小
     */
    @NotNull
    @Min(1)
    @ApiModelProperty(value = "每次请求数量", example = "20")
    private Integer pageSize;
}
